package cn.cxyxj.study01;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author cxyxj
 */
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello(){
        return "你好 Spring Security";
    }

    @GetMapping("/")
    public Authentication h(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        return authentication;
    }

}
